#pragma once
#include <WinSock2.h>
#include <WS2tcpip.h>
#include <string>

using namespace std;

class CRecv
{
public:
	CRecv(SOCKET s, int len) :m_ServerSocket(s), m_ClientSocket(INVALID_SOCKET), m_Length(len) {

	}

	CRecv(SOCKET s, SOCKET c, int len) :m_ServerSocket(s), m_ClientSocket(c), m_Length(len) {

	}

	~CRecv() {}

	int receive();

	void Exchange();

	string & getData();

	void append(const string & str);

	void clear();

	int getReceiveLength()const;

private:
	bool Done(int iLen);

private:
	int m_Length;
	SOCKET m_ServerSocket;
	SOCKET m_ClientSocket;
	string m_Data;
};

